package tec.data.persistence.oracle;

import java.sql.Connection;
import java.sql.SQLException;

import oracle.jdbc.pool.OracleDataSource;

/**
 * TODO : Test the JDBC provided by oracle and use it to connect to oracle database
 * 
 * @author Joe Choi
 * @version 0.0.1
 */

public class SQLExecuter {
	/**
	 * STORY : Connect to oracle database
	 * @throws SQLException 
	 */
	public void connect() throws SQLException {
		OracleDataSource source = new OracleDataSource();
		String url = "jdbc:oracle:oci:@orcl";
		source.setURL(url);
		source.setUser("joe");
		source.setPassword("741114");
		_conn = source.getConnection();
	}
	
	public void execute(String sql) throws SQLException {
		_conn.createStatement().execute(sql);
	}
	
	private Connection _conn;
}
